09. Lab II: Build a Dog Microservice (Spring Data REST)
Lab II: Build a Dog Microservice
Now that you have a working Eureka server, you can build out a microservice that provides information about your dogs.
Spring Data REST
Steps 1, 2 & 3 below can re-use some of your code from earlier lessons.
In a new separate module create a Microservice:
- Step 1: Create an entity called Dog. The dog should have three attributes:
- Name
- Breed
- Origin
- Step 2: Create a repository that extends CrudRepository for creating, reading, updating, and deleting Dog objects.
- Note: This repository will not need to implement anything beyond an interface.
- Step 3: Create a
data.sql
file to create sample dog data in the database. - Step 4: Create a microservice using Spring Data REST by including the proper dependency in the Maven POM file.
- Step 5: Check that you are able to access your microservice.